<?php 


echo form_open_multipart('programs_managment/new_program',array("name" => 'new-program_form', 'id' => 'new-program_form','class' =>'form-horizontal' ));
?>
<div class="alert alert-info"> <button type="button" class="close" data-dismiss="alert">×</button><strong>Informácie !</strong> Všetky položky sú povinné</div>

<?php if($error!=""){
	echo'<div class="alert alert-error"><strong>Upozornenie!</strong> Upload neprebehol, pre bližsie informácie <a href="#upload-area">kliknite sem</a></div>';	
} ?>
<?php


echo '<div class="row-fluid">';	
	echo '<div class="span12">';
    echo form_fieldset('Heslo pre upload'); 
	if(form_error($heslo['name'])!=""){
		echo '<div class="control-group error">';
	}else{
		echo '<div class="control-group">';
	}
	echo '<div class="alert alert-error" id="pass_err">
 	   	 <strong>Upozornenie!</strong> Nesprávne heslo </div>';
	echo form_label('Heslo : ', $heslo['name'],array('class' =>'control-label'  ));
	echo form_input($heslo);
	echo '<span class="help-inline">'.form_error($heslo['name']).'</span>';
	echo '</div>';
	
		//
	echo form_fieldset_close();
	echo '</div>';
echo '</div>';
echo form_fieldset('Všeobecné informácie');
	if(form_error($nazov['name'])!=""){
		echo '<div class="control-group error">';
	}else{
		echo '<div class="control-group">';
	}
	echo form_label('Názov : ', $nazov['name'],array('class' =>'control-label'  ));
	echo form_input($nazov);
	echo '<span class="help-inline">'.form_error($nazov['name']).'</span>';
	echo '</div>';
	
	if(form_error($comment['name'])!=""){
		echo '<div class="control-group error">';
	}else{
		echo '<div class="control-group">';
	}
	echo form_label('Opis : ', $comment['name'],array('class' =>'control-label'  ));
	echo form_textarea($comment);
	echo '<span class="help-inline">'.form_error($comment['name']).'</span>';
	echo '</div>';
	
	if(form_error($autors['name'])!=""){
		echo '<div class="control-group error">';
	}else{
		echo '<div class="control-group">';
	}
	echo form_label('Autori : ', $autors['name'],array('class' =>'control-label'  ));
	echo form_input($autors);
	echo '<span class="help-inline">'.form_error($autors['name']).'</span>';
	echo '</div>';


	if(form_error($requirements['name'])!=""){
		echo '<div class="control-group error">';
	}else{
		echo '<div class="control-group">';
	}
	echo form_label('Požiadavky : ', $requirements['name'],array('class' =>'control-label'  ));
	echo form_textarea($requirements);
	echo '<span class="help-inline">'.form_error($requirements['name']).'</span>';
	echo '</div>';

echo form_fieldset_close();

echo form_fieldset('Kategorizácia programu');
	//worktype
	
		echo'<div class="row-fluid">';
		echo'<div class="span10">';

		if(form_error('workType')!=""){
		echo '<div class="control-group error">';
		}else{
		echo '<div class="control-group">';
		}
		echo form_label('Typ práce :', 'workType',array('class' =>'control-label'  ));
		echo '<select name="workType" id="workType">';
			
	foreach ($workType as $key  ) {
		//echo $key->id;
		echo'<option value="'.$key->id.'">'.$key->name.'</option>';
	}	echo '</select>';
		echo '<span class="help-inline">'.form_error('workType').'</span>';
		echo '</div>';
		echo'</div>';
		echo'</div>';
		
	//classroomSubject
	echo'<div class="row-fluid">';
		echo'<div class="span6">';

		if(form_error('classroomSubject')!=""){
		echo '<div class="control-group error">';
		}else{
		echo '<div class="control-group">';
		}
		echo form_label('Predmet :', 'classroomSubject',array('class' =>'control-label'  ));
		echo '<select name="classroomSubject[]" id="classroomSubject" multiple="multiple">';
	
	foreach ($classroomSubject as $key  ) {
		//echo $key->id;
		echo'<option value="'.$key->id.'">'.$key->name.'</option>';
	}	echo '</select>';
		echo '<span class="help-inline">'.form_error('classroomSubject').'</span>';
		echo '</div>';
		echo '</div>';

		


	//language
		echo'<div class="span6">';

		if(form_error('language')!=""){
		echo '<div class="control-group error">';
		}else{
		echo '<div class="control-group">';
		}
		echo form_label('Jazyk :', 'language',array('class' =>'control-label'  ));
	echo '<select name="language[]" id="language" multiple="multiple">';
	
	foreach ($language as $key  ) {
		//echo $key->id;
		echo'<option value="'.$key->id.'">'.$key->name.'</option>';
	}	echo '</select>';
		echo '<span class="help-inline">'.form_error('language').'</span>';
	echo '</div>';
	echo '</div>';
	echo '</div>';


	//programOs
		echo'<div class="row-fluid">';
		echo'<div class="span6">';

		if(form_error('programOs')!=""){
		echo '<div class="control-group error">';
		}else{
		echo '<div class="control-group">';
		}
		echo form_label('Operačný systém :', 'programOs',array('class' =>'control-label'  ));
		echo '<select name="programOs[]" id="programOs" multiple="multiple">';
	
	foreach ($programOs as $key  ) {
		//echo $key->id;
		echo'<option value="'.$key->id.'">'.$key->name.'</option>';
	}	echo '</select>';
	echo '<span class="help-inline">'.form_error('programOs').'</span>';
		echo '</div>';
		echo '</div>';

	
	//studyLevel
		echo'<div class="span6">';

		if(form_error('studyLevel')!=""){
		echo '<div class="control-group error">';
		}else{
		echo '<div class="control-group">';
		}
		echo form_label('Určené pre :', 'studyLevel',array('class' =>'control-label'  ));
		echo '<select name="studyLevel[]" id="studyLevel" multiple="multiple">';
	
	foreach ($studyLevel as $key  ) {
		//echo $key->id;
		echo'<option value="'.$key->id.'">'.$key->name.'</option>';
	}	echo '</select>';
			echo '<span class="help-inline">'.form_error('studyLevel').'</span>';
	echo '</div>';
	echo '</div>';
	echo '</div>';




echo form_fieldset_close();
echo form_fieldset('Cesta ku programu', array('id' => 'upload-area'  ));
	echo '<div class="control-group">';
	 if($error!=""){
	echo'<div class="alert alert-error"><strong>Upozornenie!</strong> '.$error.'</div>';	
} 
echo form_label('Súbor ktorý chcete uploadnuť :', 'userfile',array('class' =>'control-label'  ));
echo '<input type="file" name="userfile" id="userfile" size="20" />';
	echo '<span class="help-inline">Akceptujeme iba súbory ZIP, do veľkosťi '.$maxUploadSize.' kb </span>';
	echo '</div>';

echo form_fieldset_close();



// echo form_submit('Submit', 'Vytvoriť program');
// ?>
<input type="submit" name="Submit" value="Pridaj program" class="btn btn-info" style="height:2em;">
<?php
echo form_close();

echo '  <script type="text/javascript" src="'.base_url().'public/js/check_pass.js"></script> ';
?>




